
<%
dim conn   
dim connstr

'on error resume next
connstr="DBQ="+server.mappath("db.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
connstr="provider=microsoft.jet.oledb.4.0;data source=" & server.mappath("db.mdb")
set conn=server.createobject("ADODB.CONNECTION")
set rs=server.createobject("ADODB.RECORDSET")
conn.open connstr 


sql = "select * from sheet1"
rs.open sql, conn, 1, 1
json = "{'total':" & rs.recordcount & ",'rows':["


Do While Not rs.eof
	json = json & "{'a':'" & rs(0) & "','b':'" & rs(1) & "','c':'" & rs(2) & "','d':'" & rs(3) & "','e':'" & rs(4) & "','f':'" & rs(5) & "','g':'" & rs(6) & "','h':'" & rs(7) & "','i':'" & rs(8) & "'},"
	rs.movenext
Loop 
json = Left(json, Len(json) - 1)
json = json & "]}"


response.write json 
%>